package boun.swe.bob.entities;

import javax.persistence.*;

/**
 * This entity corresponds to friend_requests table
 */
@Entity
@IdClass(FriendRequestPK.class)
@Table(name = "friend_requests")
public class FriendRequest {

    @Id
    @Column(name = "requesting_user_id")
    private Integer requestingUserId;

    @Id
    @Column(name = "requested_user_id")
    private Integer requestedUserId;

    @OneToOne
    @JoinColumn(name = "requesting_user_id", referencedColumnName = "user_id", insertable = false, updatable = false)
    public User requestingUser;

    public Integer getRequestingUserId() {
        return requestingUserId;
    }

    public void setRequestingUserId(Integer requestingUserId) {
        this.requestingUserId = requestingUserId;
    }

    public Integer getRequestedUserId() {
        return requestedUserId;
    }

    public void setRequestedUserId(Integer requestedUserId) {
        this.requestedUserId = requestedUserId;
    }

    public User getRequestingUser() {
        return requestingUser;
    }

    public void setRequestingUser(User requestingUser) {
        this.requestingUser = requestingUser;
    }
}
